/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.qinyeit.serviceapp.entity.enums.PaymentState;
import com.qinyetech.springstage.core.entity.AbstractEntity;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * ClassName: ReceivePaymentDetail <br/>
 * Function: 收付款明细 <br/>
 * date: 2019-03-05 10:06:31 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="receive_payment_details")
public class ReceivePaymentDetail extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 订单id
	@ManyToOne
	@JoinColumn(name="order_id")
	private ReceivePayment order = null;

	// 原始单号 
    @Column(name="order_no", length = 300)
	private String orderNo = null;

	// 单据金额 
    @Column(name="order_amount",scale=2)
	private Double orderAmount = null;

	// 还/收款金额 
    @Column(name="amount",scale=2)
	private Double amount = null;

	// 优惠金额 
    @Column(name="gift_amount",scale=2)
	private Double giftAmount = null;

	// 是否结清 
    @Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private PaymentState paymentState = PaymentState.NORMAL;


    @Tolerate
	public ReceivePaymentDetail() {
		
	}
    @Tolerate
	public ReceivePaymentDetail(Long id){
    	super.setId(id);
    }

	/**
	 * 获取原始单号
	 */
	public String getOrderNo() {
		return this.orderNo;
	}

    /**
     * 设置原始单号
     */
	public ReceivePaymentDetail setOrderNo(String orderNo) {
		this.orderNo = orderNo;
		return this;
	}

	/**
	 * 获取单据金额
	 */
	public Double getOrderAmount() {
		return this.orderAmount;
	}

    /**
     * 设置单据金额
     */
	public ReceivePaymentDetail setOrderAmount(Double orderAmount) {
		this.orderAmount = orderAmount;
		return this;
	}

	/**
	 * 获取还/收款金额
	 */
	public Double getAmount() {
		return this.amount;
	}

    /**
     * 设置还/收款金额
     */
	public ReceivePaymentDetail setAmount(Double amount) {
		this.amount = amount;
		return this;
	}

	/**
	 * 获取优惠金额
	 */
	public Double getGiftAmount() {
		return this.giftAmount;
	}

    /**
     * 设置优惠金额
     */
	public ReceivePaymentDetail setGiftAmount(Double giftAmount) {
		this.giftAmount = giftAmount;
		return this;
	}

	public ReceivePayment getOrder() {
		return order;
	}

	public void setOrder(ReceivePayment order) {
		this.order = order;
	}

	public PaymentState getPaymentState() {
		return paymentState;
	}

	public void setPaymentState(PaymentState paymentState) {
		this.paymentState = paymentState;
	}
}
